#pragma once

#include <iostream>
#include <fstream>

#include <string>
#include <vector>
#include <stack>
#include <map>

static const std::locale zh_cn = std::locale("", std::locale::all ^ std::locale::numeric);

static std::wifstream fin;
static std::wofstream fout;

static std::wistream& in = std::wcin;
static std::wostream& out = std::wcout;

static inline void init_stream() {
	fin.imbue(zh_cn);
	fout.imbue(zh_cn);

	in.imbue(zh_cn);
	out.imbue(zh_cn);
}

struct Error
{
	std::string msg;
	std::string file_name;
	size_t line;
	Error(std::string m, std::string fn, size_t l) :
		msg(m), file_name(fn), line(l) {}
};


inline std::ostream& operator<<(std::ostream& os, Error e)
{
	os << e.msg << ":" << e.line << " at " << e.file_name << std::endl;
	return os;
}

#
#include "token.h"
#include "type.h"
#include "analysis.h"
#include "work.h"